/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 50720
 Source Host           : localhost
 Source Database       : comac_template

 Target Server Type    : MySQL
 Target Server Version : 50720
 File Encoding         : utf-8

 Date: 06/08/2020 10:46:16 AM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `t_sys_dict`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_dict`;
CREATE TABLE `t_sys_dict` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) DEFAULT NULL,
  `label` varchar(100) COLLATE utf8_bin NOT NULL COMMENT '显示名',
  `code` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '编码',
  `sort` int(2) NOT NULL COMMENT '排序',
  `del_flag` tinyint(4) DEFAULT NULL COMMENT '删除标记',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='系统字典表';

-- ----------------------------
--  Table structure for `t_sys_log`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_log`;
CREATE TABLE `t_sys_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `remote_addr` varchar(255) DEFAULT NULL,
  `request_uri` varchar(255) DEFAULT NULL,
  `method` varchar(25) DEFAULT NULL,
  `params` varchar(2000) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `exception` varchar(2000) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `login_name` varchar(255) DEFAULT NULL,
  `begin_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2716 DEFAULT CHARSET=utf8 COMMENT='操作日志表';

-- ----------------------------
--  Table structure for `t_sys_menu`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_menu`;
CREATE TABLE `t_sys_menu` (
  `id` bigint(64) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(64) DEFAULT NULL COMMENT '父级编号',
  `menu_name` varchar(100) COLLATE utf8_bin NOT NULL COMMENT '名称',
  `sort` int(11) DEFAULT NULL COMMENT '排序号',
  `href` varchar(500) COLLATE utf8_bin DEFAULT NULL COMMENT '路由路径',
  `menu_icon` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '图标',
  `menu_type` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT '菜单类型（菜单，按钮）',
  `is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否显示（0：否，1：是）',
  `permission` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '权限标识',
  `create_user` bigint(20) NOT NULL,
  `create_time` datetime NOT NULL,
  `modify_user` bigint(20) NOT NULL,
  `modify_time` datetime NOT NULL,
  `del_flag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='系统菜单表';

-- ----------------------------
--  Records of `t_sys_menu`
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_menu` VALUES ('1', '0', '系统管理', '0', null, 'setting', 'MENU', '1', null, '1', '2020-02-21 11:46:33', '1', '2020-02-21 11:46:33', '0'), ('5', '1', '用户管理', '0', '/sys/user', null, 'MENU', '1', 'sys_user_view', '1', '2020-02-21 14:48:13', '1', '2020-02-21 14:48:13', '0'), ('6', '1', '角色管理', '1', '/sys/role', null, 'MENU', '1', 'sys_role_view', '1', '2020-02-21 14:55:51', '1', '2020-02-21 14:55:51', '0'), ('7', '1', '菜单管理', '2', '/sys/menu', null, 'MENU', '1', 'sys_menu_view', '1', '2020-02-21 14:56:10', '1', '2020-02-21 14:56:20', '0'), ('9', '6', '新增', '0', null, null, 'BUTTON', '1', 'sys_role_add', '1', '2020-02-25 11:32:39', '1', '2020-02-25 11:41:15', '0'), ('10', '6', '编辑', '1', null, null, 'BUTTON', '1', 'sys_role_edit', '1', '2020-02-25 11:32:58', '1', '2020-02-25 11:32:58', '0'), ('11', '6', '删除', '2', null, null, 'BUTTON', '1', 'sys_role_del', '1', '2020-02-25 11:33:14', '1', '2020-02-25 11:33:14', '0'), ('12', '7', '新增', '0', null, null, 'BUTTON', '1', 'sys_menu_add', '1', '2020-02-25 11:41:05', '1', '2020-02-25 11:41:05', '0'), ('13', '7', '编辑', '1', null, null, 'BUTTON', '1', 'sys_menu_edit', '1', '2020-02-25 11:41:38', '1', '2020-02-25 11:41:38', '0'), ('14', '7', '删除', '2', null, null, 'BUTTON', '1', 'sys_menu_del', '1', '2020-02-25 11:42:15', '1', '2020-02-25 11:42:15', '0'), ('15', '5', '新增', '0', null, null, 'BUTTON', '1', 'sys_user_add', '1', '2020-02-25 11:42:34', '1', '2020-02-25 11:42:34', '0'), ('16', '5', '编辑', '1', null, null, 'BUTTON', '1', 'sys_user_edit', '1', '2020-02-25 11:42:49', '1', '2020-02-25 11:42:49', '0'), ('17', '5', '删除', '2', null, null, 'BUTTON', '1', 'sys_user_del', '1', '2020-02-25 11:43:02', '1', '2020-02-25 11:43:02', '0'), ('22', '1', '字典管理', '4', '/sys/dict', null, 'MENU', '1', 'sys_dict_view', '1', '2020-02-25 15:15:37', '1', '2020-02-26 11:26:21', '0'), ('23', '22', '新增', '0', null, null, 'BUTTON', '1', 'sys_dict_add', '1', '2020-02-25 15:15:55', '1', '2020-02-25 15:15:55', '0'), ('24', '22', '编辑', '1', null, null, 'BUTTON', '1', 'sys_dict_edit', '1', '2020-02-25 15:16:14', '1', '2020-02-26 09:40:52', '0'), ('25', '22', '删除', '2', null, null, 'BUTTON', '1', 'sys_dict_del', '1', '2020-02-25 15:16:30', '1', '2020-02-26 09:41:00', '0');
COMMIT;

-- ----------------------------
--  Table structure for `t_sys_role`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role`;
CREATE TABLE `t_sys_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '角色名称',
  `code` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '角色编码',
  `remark` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '描述',
  `create_user` bigint(20) NOT NULL,
  `create_time` datetime NOT NULL,
  `modify_user` bigint(20) NOT NULL,
  `modify_time` datetime NOT NULL,
  `del_flag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标识',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='系统角色表';

-- ----------------------------
--  Records of `t_sys_role`
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_role` VALUES ('1', '管理员', '1001', 'test', '1', '2020-02-21 11:15:34', '1', '2020-05-11 20:02:53', '0');
COMMIT;

-- ----------------------------
--  Table structure for `t_sys_role_menu`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_role_menu`;
CREATE TABLE `t_sys_role_menu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) NOT NULL COMMENT '关联t_sys_role',
  `menu_id` bigint(20) NOT NULL COMMENT '关联t_sys_menu',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=268 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='系统角色-菜单表';

-- ----------------------------
--  Records of `t_sys_role_menu`
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_role_menu` VALUES ('246', '1', '1'), ('247', '1', '5'), ('248', '1', '15'), ('249', '1', '16'), ('250', '1', '17'), ('251', '1', '6'), ('252', '1', '9'), ('253', '1', '10'), ('254', '1', '11'), ('255', '1', '7'), ('256', '1', '12'), ('257', '1', '13'), ('258', '1', '14'), ('259', '1', '22'), ('260', '1', '23'), ('261', '1', '24'), ('262', '1', '25');
COMMIT;

-- ----------------------------
--  Table structure for `t_sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '系统登录名',
  `real_name` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '真实人员姓名',
  `password` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '密码',
  `email` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '手机号',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态（不可用，可用）',
  `create_user` bigint(20) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `modify_user` bigint(20) DEFAULT NULL,
  `modify_time` datetime DEFAULT NULL,
  `del_flag` tinyint(4) DEFAULT '0' COMMENT '是否删除（0：否，1：是）',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='系统用户表';

-- ----------------------------
--  Records of `t_sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_user` VALUES ('1', 'admin', '超级管理员', '$2a$10$wPutzQCcWM83TqG.YI72NuMALHUN/8njXLxCwl50pIyEhpxWuy.Vm', '', '', '1', null, '2020-02-20 14:05:59', '1', '2020-05-12 08:58:52', '0');
COMMIT;

-- ----------------------------
--  Table structure for `t_sys_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_role`;
CREATE TABLE `t_sys_user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '关联t_sys_user',
  `role_id` bigint(20) NOT NULL COMMENT '关联t_sys_role',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='系统用户-角色表';

-- ----------------------------
--  Records of `t_sys_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `t_sys_user_role` VALUES ('12', '1', '1');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
